package com.thesis.manage.service.impl;

import com.thesis.manage.common.service.impl.BaseServiceImpl;
import com.thesis.manage.domain.Admin;
import com.thesis.manage.mapper.AdminMapper;
import com.thesis.manage.service.AdminService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper;

import javax.annotation.Resource;

/**
 * @author php
 * @date 2018/2/1
 */
@Service
public class AdminServiceImpl extends BaseServiceImpl<Admin> implements AdminService {
    @Resource
    private AdminMapper adminMapper;

    @Override
    protected Mapper<Admin> getMapper() {
        return adminMapper;
    }

    @Override
    protected Class<Admin> getEntityClass() {
        return Admin.class;
    }

    @Override
    public Admin findByName(String name) {
        Admin admin = new Admin();
        admin.setName(name);
        return this.findByOne(admin);
    }
}
